package com.ssm.zhihu_ssm.util;

import com.ssm.zhihu_ssm.entity.User;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ReturnMap {
    public static Map<String, Object> ReturnMapS(Object obj) {
        Map<String, Object> map = new HashMap<String, Object>();
        if (obj!=null)
        {
            map.put("code",200);
            map.put("msg","成功");

        }else {
            map.put("code",500);
            map.put("msg","失败");
        }
        map.put("data",obj);
        return map;
    }

    public static Map<String, Object> Returncode(Object obj) {
        Map<String, Object> map = new HashMap<String, Object>();
        if (obj.equals("200"))
        {
            map.put("code",200);
            map.put("msg","成功");

        }else if(obj.equals("201")) {
            map.put("code",201);
            map.put("msg","失败");
        }else if(obj.equals("202")) {
            map.put("code",202);
            map.put("msg","失败");
        }
        map.put("data",null);
        return map;
    }
}
